<?php
namespace Common\Model;

use Think\Model;

class MenuModel extends Model
{

    protected $tableName = 'top_menu';

    function get()
    {
        $key = 'manager_top_menu';
        $list = S($key);
        if ($list === false) {
            $map['is_hidden'] = 0;
            $list = $this->where($map)
                ->order('sort asc, id asc')
                ->select();
            S($key, $list, 86400);
        }
        
        return $list;
    }

    function clear()
    {
        $key = 'manager_top_menu';
        S($key, null);
    }
}
?>
